refactored sample code