Moved serialize stuff around