Refactored to use stand-alone motion class