context factory rewrite and redifinition of transported contexts