added db initialization, removed unneeded DbAdapter struct, and other small improvements