Refactoring a big method into some smaller ones.