Better parsing of mnemonic, code cleanup, still not perfect