Cleaned up the move code