Refactored check for habitrails into its own method.