Refactored how to are re-encoding a bit. Next step is to actually decode and re-encode.