optimize some code of original