Bit of procedural sorting

Move the OnLinkClick handler a bit upwards!