Much simplify downloading function, extract from the actual page