restructure, fix script