RM-1445m Implemented link-to rule. Also fixed RM-1466 and RM-1470 while refactoring common code