Prefer custom code fragment factory on context change