improvments and fixes