Add autogen warning. Refactor for readbility.