fix and clean up the monkey patch (no need to patch Database)