Cleaned implementation from std::cout