DRYed transformation command

extracted the moving part into its own method.