Refactoring and commenting