faster implementation for js&style processing