Removed hash iteration from view and moved it into controller