more separation of concerns and reworking of config