update more code around contexts