Refactor BackMonad to Result and created tests