many "best practices" improvements
small bugfixes