refactor status command