Code factorisation for yielders