Refactor to avoid redundant calls