Renaming nested function for clarity