Refactor parse spec to deserialize spec
Add serializable