Reflection enhancement

Refactoring, some files added and some fixes.