Remove unused theta function code