Improved consistency and clarity, added documentation of sorts.