Added logging features and Threading Functionality