Re-did command handling and some formatting