cleaning up and using the format macro