Improvements to .lay-file generation