Minor optimization when changing program