Refactoring print statments