Migrate plugin functions back into Main class