minimilized a few more if statements