moving DB code to a separate classes; add mapper and persistable interfaces