Major refactoring of AisStore