refactored cloud into a motion function of its ow