refactoring blocks