Made application db-independent -- or, db-configurable
Prettified code