Refactor error handling and add ability to change account from command line