refactor billing