cleaned up command code definition