star: cleanup and add star-related codes