More refactoring to make test.htm happy