improvement as in #4