Convert to SQLAlchemy and clean up pages.