Refactored most things.