refactor module to class