minor refactoring for version 1.2