new examples
remove unnecessary line
add null check
simplify a bit