general improvements of code