Remove LinkedDocument class and calculate linked documents programatically