WIP upgrade refactors