Refactor index/maing and download