Fix the messy code in plugin.