refactoring simple checks in Collector class