APY-34 : Refactor encoder

Still having problems at combine.