refactoring, added blocks