refactoring in GtFunc