refactor address generation and WIF