Use Dictionary of role and function to pass context to index template