clean up conversions functions and add doc