balance refactor completed