refactor proxy to take nil as a special case