unifying context and sub context handling