All DB logic removed from application except for two classes