update hotspot to v4 and clean up codes for modularity need.