Condense code for return a boolean