refactoring plus comments