Refactored ERB reading to lazy-load templates