As above, creating these variable at the top of the function, rather than where they are used is not desirable in my opinion.