Removed anonymous function encapsulation and replaced it with do/end for readability