Updated with removing useless code.