refactor motion