Code Cleanup and fixed Debug Log messages