Refactored analysis logic into DLL