Use event to remove code duplication