refactor code
add sample code