moved client db operations to seperate model