Modified code for new abstract/sqlite structure.