Refactor for proper journal sorting function.