refactoring auto status update script