reorganize some code for gstriker (no functional change) (nw)