Refactor meta data, flesh out the state file