partially switch to functional java