Overlay feature: refactor js code for overlay feature and finalized building this feature