split off sample code