bugfixes and better naming