pulled utils back out -- cleaned up some redundant code and changed some if/else statements to switches to reuse then blocks (also expecting to add more cases using existing logic)