refactor modal module