Improve logic flows in bitmessagemain.py