refactor chunk solution