various improvements and bugyfixes