Remove all that
Make that a function.
And exercise it.