replace wrap_context with NovaDB class