moved as much into config as possible
more refactor