optimze code, add unit test