eliminate overhead of creating two funcs/closure for each port connection