Consolidate accounts (and some refactor)