Moved some code blocks for better readability in PHP renderer's serializer