Refactored are_good() code