Refactoring motion correction