Move deserialize functions to extension methods