Refactoring charge/run.py