changed Database implementation