Moving out serialize object into a separate module.