add example & code cleanup