split algorithms according to function and move into separate module