better handling of optional files