spatialite code cleanup