refactor context into its own file

test plan: none