removing unused variables. stick to underscore-less naming conventions. correct debug logs, log contextual errors.

removing unused variables. 
stick to underscore-less naming conventions. 
correct debug logs, log contextual errors.
Could we get the logs into a String variable and then use it in both logging and throwing ?