cleaned code from reflector