Remove useless code. Change order in if statements. if else if -> switch