Huge update code refactorings.