Refactor details a bit.
Refactor documentation and magicnumbers.