refactoring and comments on methods