[WORKING] Refactored more code. Starting 3rd iteration.