Clean up command code.