close #172 minor refactoring