Major refactoring of most update loops