implemented Command pattern