Refactor States