State storage refactoring, moving to sql schema normalization