More refinements

More refactoring