Moved some helper methods from Jaffas to the core.