Remove unnecessary blocks