refactoring charging