Restructure states to be separate files