use boolean short-circuiting better