Simplified some closure-related code (removed useless code)