Refactored. I think I'm done.