Reduce complexity of format method