Refactoring (long method)