All this could probably do with some space/tab mangling. No comment whatsoever on the definitions themselves. I'll leave that to someone else