reduced complexity by extracting methods