refactors excluder method to ensure it works with ruby 1.93