return flattened object from generate.js and moved all UI generation to jade