Refactor modules for more convenient structure