refactored chunk generation