use built-in command, remove useless function