Move logic to link function.