Refactor .attr