added Command pattern