refactor class into a module