refactor away object and move config into config code