check for valid command before creating db, simplify dispatch