minor refactoring wrt #40