Added config, refactoring