make few optimizings on js's struct