Code style fixes + moving more parsing functionality out