Moved DB controller to Model