Extract modules for related logic