Algo refact