separate algorithm class