MySQL refactor in progress