add improvements from comments