Might consider breaking this procs into methods to make them easier to read. Especially if they get any bigger