Remove (most) unneeded MySQL code