Why is this inside a function?