Further work and cleanup