some clean up and refactoring

5 jobs for master in 14 minutes and 40 seconds