improving sample code layout