refactor: move static helper methods to db class
lint
enhance: improve contract
enhance: unit tests code complete