refactor polymer elements with template repeating