Making database constructor