guard build_rules and build_views variable in closures