Coding style change

Changed PHP to OOP, and updated the initialization structure