refactored config into class of its own