Added collections management and improved logging