refactor BaseLogic.