Refactor-Optimized

Refactor and Optimized code.
Use include search.php instead of .inc for better readability in github