extract Either helper functions