refactor from monads to wrappers