Minor refactoring: global jam, more helper methods to encapsulate jam functionality.