Refactored Actor and the utility functions