refactoring for #11