reduce complexity and duplication