Simplify and remove dead code.
Don't set links sometimes