refactoring, added config