add command pattern into main