format and remove last else