Move debug stuff to debug block