Serialize profiles more efficiently