Created a seperate class for serialization