Removes unnecessary closures.