Refactored common module. Updated perflog. Added error handling into
perflog.