refactorings and changes in printer
Merge branch 'capitalised_type_variables'
small refactorings