Kaa-176: Refactor Kaa service to be independent from actual DB implementations