minor cleanups which supposed not to change logic, but
make code cleaner. pull #184