change structure, add Command pattern