some smaller code improvements