Refactored establishing the dealer to purely functional