some tidying up in WS.commands