moved DB code to seperate class