simplifying a bit of logic