general corrections and beautification