Some refactoring

For better or for worse? It remains to be seen.