refactor status pattern