Replace all the if's with a select case

It looks cleaner and uses less code