#25 + refactoring