reorg core logic into separate dll