Extract logic from footer to helper