some cleanup & fixing on scripts