cleanup tests, added db.getClass()
refractor db requests