Fixes #5081 simpler check for non-view files and deprecated some unused code