minor refactoring (issue #1284)