cleanup ugly mixture of oct/hex codes