reduced redundancy in code