refactoring fixes #18