* Moved global variables call inside conditional statement as they are not needed if we do not have comments.
* General minor code refactorings and improvements