Add pretty printing
Enchance display and minor refactorings