refining database constructor