optimize sequence of &&