Extract printing helpers into separate module