separate sample code from main code