deleted database.php refactored code