refactoring + comments