refactor to make more module