Refactor large method into smaller methods.