Refactor: reduce complexity.