Some refactoring; work in progress on collection type updates