Updated print css and refactored code