refactored to interface with Gctp