rewrite autofocus to a standardized version