Moving DB operations to DB access layer