Refactor ModuleActions code