made some improvement for reflection