Refactoring. Adding comments