cleanedup last if statement