First draft of command handling