refactor 'gx' to 'g'