restructure to state folder
handle commit and freelist