Refactoring to use the jf library