Improve appearance sample code.