Move check of pathogen installation to a function