refactoring for #13