Refactored a few things.