Refactor big method.