recursively parsing and merging modules