refactored the visitor so that it can be used with arbitrary monads
changed tactic from a monad transformer to a simple monad.