major overhaul: streamlining handling of common files