Seems this change will produce the same output with half the code