changed how contexts are initialized