add cache and reduce reflection