class CompetitionSetupServiceImpl implements CompetitionSetupService {

    @Override
    public ServiceResult<Void> saveCompetitionSetupSubsection(CompetitionSetupForm competitionSetupForm,
                                                              CompetitionResource competitionResource,
                                                              CompetitionSetupSection section,
                                                              CompetitionSetupSubsection subsection) {

        checkCompetitionInitialDetailsComplete(competitionResource, section);
        checkIfSubsectionIsInSection(section, subsection);

        CompetitionSetupSubsectionUpdater saver = subsectionSavers.get(subsection);
        if (saver == null || !saver.supportsForm(competitionSetupForm.getClass())) {
            LOG.error("unable to save subsection " + subsection);
            throw new IllegalArgumentException();
        }

        ServiceResult<Void> result = saver.saveSection(competitionResource, competitionSetupForm);
        result.andOnSuccess(() -> {
            markQuestionAsComplete(subsection, competitionSetupForm, competitionResource.getId());
            markSubSectionAsComplete(subsection, competitionResource.getId());
        });

        return result;
    }

}