BBB Sample: clean up the code