Refactoring. Extracting code in methods for readability