implement prototype parse function