modules_manager refactor