Refactoring of array layout and HTML template in preparation for #95