Update Serializer.php

Avoid nesting…