Prefer custom code fragment factory on context change

For automatically choosing custom code fragment factory on context change