WLS: making some progress tidying a few things up here and there.