set flag first
refactoring part I
additional bindings
cleanup