Get rid of giant if statement