calculate correlator, split code

Signed-off-by: Riccardo Iaconelli <riccardo@kde.org>
add also this

Signed-off-by: Riccardo Iaconelli <riccardo@kde.org>