Completely restructured intern.php and moved long Code in extern Files