Refactored a bunch AGAIN!