Cleans up feature detection code.