DRY'd up popup, refined routes