refactoring shad: split in modules