why declare this separately instead of make it an anonymous function