simplify and merge a bunch of code. Instead of comparing against