refactor gSend as a class