add sample code to refactor 2