restaurant index template code refactored