Cleaning old box pass for easier translation. Factored out a helper function that is slightly simpler as a helper instead of in the larger function.