Refactor module to support new deploy step and use macro