Better handling AVPs and type conversion