itd be awesome to remove this type of ruby logic from the view, and find an elegant way to abstract them into nice helper methods