Optimize miscellaneous scripts