Moved constants to CodecConstants. Some code cleanup.