This is awful.  Any suggestions on how this could be better implemented?