Took some hardcode from the index.php and moved to PHP functions