refactoring on status changes