Download feature working, starting to refactor code