receiver: refactor analytics
refactor scripts
extension: improve for easy to debug