* extract common methods from oss and ent * remove unreachable code * add missing normalize for binding rules * fix oss to use Query