refactor of server_databases.php