Use types to improve NodeLayout for programs