Reduction of delayed optimal control problems to nondelayed problems