Combine classes for flexibility in actionListener