Extract state sub-classes into separate files