Refactor Grid View and Horizontal List View: remove code duplications