add lambda and streams + simplify code