Habitat niches and species specialisation