Split out some more useful functions for use from the REPL