Clean up unnecessary closure leading to possible memory leak