rewrite to emmiter logic
rewrite to emmiter logic