Moved DB queries to a seperate file