utils: cleanup and debugging