improved command constructor