refactored router and grocery view