Generic listeners for less code duplication.