Refactored some.