Made the parse functions generic