Refactor using fetch and get method.