Make active highlight logic more centralized and reliable