Improve generation of attributes and some CS