check for same type on switchType
refactor events
fix cache busting