refactor Context into smaller components