Refactor the common decoder functionality into a CommonDecoder class