refactoring physics