Refactor LogicException