Refactor onto tests to remove improve isolation and focus on functionality