Refactor modules