rewriting the source generating code, work in progress