refactor winlogic with lorin