multiple improvings and fixes