[relate] cleanup, increase the readability of relate() dispatching, remove unneeded code