add extractMap function to flatten the monads a bit