Created functions to condense admin-panel.php