seperated side effects from expressions by introducing variables for guards and expressions with operators