Refactor

Refactor some commands.