Updated code to abstract the reflection logic a bit more behind a strategy interface.