Clean up orientation encoding