Refine the code

Separete the URL and MySQL to single file.