Refactored big method implementation.