Improve ui sample