Better code for no-files case and result initializaion