Simplify continuation code by using ContT