removing redundancy in ternary operation within boolean method