refactered move with three helper functions