Use File.join and case-when in a few more places