Improved docs and logging