Refactor download related codes
Resource object