Improve private checking and pretty print