bit more work, mostly cleaning up things