Script changed and more cleanups