cleanup of movment code