working with generic database