Better log helper and removed some debug code