moved code to razor helper