Move logic out of Plugin.php to respective assets