refactoring chunks