Introduced phi_fun object to simplify line search