Refactor complete!
Well, almost...