Code factorize / scope reduction