It seems to me a bit too complex. I think it can be made much simpler.