refactoring fixes #1