utilities for using StateT with mutable variables