Moved the random movement into a separate method