Some documentation (at least a comment block) would be helpful to understand what's going on here.