refactored RSEM main script