improved mysql interface