improvings and bugfixes