Comment reformatting
Memoize detection method.