Download class refactoring with Helper functions