serializer: a little bit better code
apply: passing tests