abstract out download button behavior