output generator, code housekeeping, added TODOs