Wiggle Storage

Moved database code out of view functions