Implemented Command pattern