adding Command pattern