Refactored StarScript