Refactored on the file level. Fixed concurrency issues.