refactoring + commenting