Move coord conversion functions into module