speed up zd redirect
slight refactor (tried to change, left as is)