A cooler device comprising a cooling portion with at least one tubular element which has an internal flow duct for guiding a first medium between a first and a second tank. A second cooling medium in contact with an outside surface of the tubular element cools the first medium as it is led through the flow duct. A first tank receives the first medium before it is led into the cooling portion. The first tank has an outside surface provided with protruding material portions which produce an enlarged contact surface with the cooling second medium so that the first medium is subjected to a first step of cooling within the first tank.