second attempt to incapsulate core.php