better design pattern for onHit