Refactor modules and implement Serializer.