refactored framing codes