decoupled and removed unused components from copied netcdf reader code