cleaned up detection of optional features