Refactored PHP code for raptorWeb project.