Integrate into encoder for huge improvement in performance