clean up; parameterise the move function