Refactoring + add configuration file