Reverted cleanup commit that broke the code