beautify some codes