refactor algorithms