Cleanup code & add comments in gpt module