refactor pipeline, use factory to new command.