new attrs, refactor template