improvements from comments