fix logic compiler
refactor