This should possibly live in the mysql class?