Source:
<code>private AggStats computeAggStatsForDay(final Long accountId, final DeviceId deviceId, final DateTime targetDateLocal, final Integer timeZoneOffset) { final DateTime startLocalTime = targetDateLocal.withHourOfDay(AggStats.DAY_START_END_HOUR); final DateTime endLocalTime = targetDateLocal.plusDays(1).withHourOfDay(AggStats.DAY_START_END_HOUR); final DateTime startUTCTime = startLocalTime.minusMillis(timeZoneOffset); final DateTime endUTCTime = endLocalTime.minusMillis(timeZoneOffset); final Response<ImmutableList<DeviceData>> deviceDataListResponse = deviceDataDAODynamoDB.getBetweenLocalTime(accountId, deviceId, startUTCTime, endUTCTime, startLocalTime, endLocalTime, deviceDataDAODynamoDB.ALL_ATTRIBUTES); LOGGER.trace("processor=agg-stats action=queryed-device-data account_id={} targetDateLocal={} status={} len_data={}", accountId, targetDateLocal.toString(), deviceDataListResponse.status.toString(), deviceDataListResponse.data.size()); final ImmutableList<TrackerMotion> pillDataList = pillDataDAODynamoDB.getBetweenLocalUTC(accountId, startLocalTime, endLocalTime); LOGGER.trace("processor=agg-stats action=queryed-tracker-motion account_id={} targetDateLocal={} len_data={}", accountId, targetDateLocal.toString(), pillDataList.size()); final Optional<Device.Color> senseColorOptional = getSenseColorOptional(senseColorDAO, deviceId); final Optional<Calibration> calibrationOptional = getCalibrationOptional(calibrationDAO, deviceId); <START> final AggStats aggStats = AggStatsComputer.computeAggStats(accountId, deviceId, targetDateLocal, deviceDataListResponse.data, pillDataList, senseColorOptional, calibrationOptional); <END> return aggStats; }</code><technical_language>parameters. Create a class holds of coherent group</technical_language>

Target:
private AggStats computeAggStatsForDay(final Long accountId, final DeviceId deviceId, final DateTime targetDateLocal, final Integer timeZoneOffset) { final DateTime startLocalTime = targetDateLocal.withHourOfDay(AggStats.DAY_START_END_HOUR); final DateTime endLocalTime = targetDateLocal.plusDays(1).withHourOfDay(AggStats.DAY_START_END_HOUR); final DateTime startUTCTime = startLocalTime.minusMillis(timeZoneOffset); final DateTime endUTCTime = endLocalTime.minusMillis(timeZoneOffset); final Response<ImmutableList<DeviceData>> deviceDataListResponse = deviceDataDAODynamoDB.getBetweenLocalTime(accountId, deviceId, startUTCTime, endUTCTime, startLocalTime, endLocalTime, deviceDataDAODynamoDB.ALL_ATTRIBUTES); LOGGER.trace("processor=agg-stats action=queryed-device-data account_id={} targetDateLocal={} status={} len_data={}", accountId, targetDateLocal.toString(), deviceDataListResponse.status.toString(), deviceDataListResponse.data.size()); final ImmutableList<TrackerMotion> pillDataList = pillDataDAODynamoDB.getBetweenLocalUTC(accountId, startLocalTime, endLocalTime); LOGGER.trace("processor=agg-stats action=queryed-tracker-motion account_id={} targetDateLocal={} len_data={}", accountId, targetDateLocal.toString(), pillDataList.size()); final Optional<Device.Color> senseColorOptional = getSenseColorOptional(senseColorDAO, deviceId); final Optional<Calibration> calibrationOptional = getCalibrationOptional(calibrationDAO, deviceId); final AggStatsInputs aggStatsInputs = AggStatsInputs.create(senseColorOptional, calibrationOptional, deviceDataListResponse, pillDataList); final AggStats aggStats = AggStatsComputer.computeAggStats(accountId, deviceId, targetDateLocal, aggStatsInputs); return aggStats; }