Make states code more efficient - else if instead of if