Refactored printf in example