Refactor to Algo Object