removed repetitive object initialization in sample code