close #159 minor refactoring