rewrote parts of the reflection api