// some more mysql refactorization