think it's a matter of personal taste. i usually wait for 3 or more occurrences before i start worrying about DRYness. but you're right in mentioning that there's enough logic. this amount of logic is not good in the view, so i'll extract-out a helper method, which will solve our purpose.