refactoring + cleaning