refactoring towards registry improvements (for state saving)