fix special cases where anonymouse functions shouldn't indent so much, remove unused functions