easy way to clean up some code == use the either monad