remove stray space
refactor some shared code for p and non-p  variants in StateT,ContT