front: Move download function to utility class for reuse.