Move out context class to a separate file.