move simple converting functions into separate module