bugfixes and config to class