refactor to abstract commonly used functions across schema instances