flatten if logic in treasury_files

related to #70