cleanup of julian function