simplifying algos structure