extraced the debug lines to own class