stub connect function added, macros refactored