serializable state storage and reading in main class