Created a Database class and moved the appropiate methods there.