Use Lambda and Procs to refactor