Relations generation improvement