Split class to module

With help of Thierry E.