Re arrange into plugin class mainly