Make it a standalone class, instead of private subclass of database. Unfriend database and instead make wrap/unwrap methods public, so anyone can use them.
As a first step towards disentangling it from database and allowing it to be used by other classes (like table) too.