Refactor arm decoding