fix some name&indent&logic