refactor to module