refactor of move method