Moving the database queries into a seperated file.