code refine for ship