Improvements of working code