Refactor module to major upgrade 4.x