Fixes and rewrite to conditions format