Change lambdas to use reference and not copy
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>