refactor to functional approach

Signed-off-by: Sebastian Schüpbach <sebastian.schuepbach@unibas.ch>
3 jobs for master in 5 minutes and 31 seconds (queued for 1 second)