Yes, I think that your implementation is actually good.