refactoring. mysql.