* remove unnecessary code
* handle possible null pointer