Fixing broken tests, extracting parseToggle method and adding parseToggle test