is this inner function still needed?