pkg_stx* code reduction + docs