Code Refactoring - extract long method