Replace unnecessary external function with internal function