Refactoring Download Page Code