refactoring to bookkeeping_core