Refactored PHP to utilize classes