Move annotation utilities to separate file.
Added rules to work with barriers.