added Command design pattern