Integrated dealer function into dealer object and cleaned up code