changed the way of getting exception message
added doc blocks
renamed two methods so the names are more descriptive
fixed linting issues