cleaning up if blocks