Combine macro to reduce duplication
Work in progress: improve module/port creation