New code structure and comments, simplifying