Refactored more templates and rewrote demo page