Is this the correct impl? Seems a bit fragile with the commented out code.