factor out state file from config file