restructuring to add more optimization algorithms