refactor, support select command