Refactored fetch to a separate file