a bit of refactoring in 1881