Performance improvement -- generating needed files