refactor to have specific object to access db