Code cleanup and fix issue when no 'reports' directory exists.
Code cleanup