Refactor name and states