more tests, separated db implementation and a logger