remove logic redundancy