refactoring, change code, add comments