Refactor to simplify internal function calls