move db access moethods to model module