imroved conversion functions