moved shared functions to utilities, added db conversion utility