What is the disadvantage of making a nested function like this?