Move conversion methods to util