refactor
diff --git a/heka/server.sls b/heka/server.sls
index 88e40cf..ade7c9c 100644
--- a/heka/server.sls
+++ b/heka/server.sls
@@ -30,7 +30,7 @@
     - pkg: heka_packages
 
 {%- for chain in [ "input","output","decoder","encoder","filter","splitter" ] %}
-{%- for name,values in server.input.iteritems() %}
+{%- for name,values in server.[{{ chain }}].iteritems() %}
 
 /etc/heka/conf.d/100-{{ chain }}-{{ name }}-{{ values['engine'] }}.toml:
   file.managed: