Going to refactor this whole thing. Again.