Some refactoring
Update php doc