fix tests and serializer refactoring