Fix. Simplyfy sample code

Remove unnecessary codes.