moved exclude checker to its own method