Link Encoder Refactor & Test