Attempted to reduce complexity.