improve debug page + complementary function