remove duppicate print method refactor code to use new methods