Refactor db util to class