optimize codes after discussing with @Mooophy.