I am cleaning this up to be a separate function though. It shouldn't be all dumped in there like that.