Serializing resources better