Download button and refactoring