REFACTOR: using template inheritance to clean HTML