extract handler creation to separate class