General improvements
Introducing specific Exception to throw instead of RuntimeException
Minor formatting corrections and documentation.