Refactored just about everything