use indexWhere/remove for better performance