Compact threading machine