Printf refactoring