refactor select api