refactor scandb.py into scandb.py and scandb_schema.py