split MySQLMultimaster.saveTask into functions