Now the element / fg / bg functions are passed to the actual Layout function, not first put to the style. This avoids moving of the element function to heap.