refactoring code with logger and config enviroment app