Refactored some things.