separated command handling into classes