Upgrading + refactor.