Cleaner Implementation of Test and Set