Now generate .h and .cpp separately.

Returned old piece of code in CLOSING for it's faster.