Cleanup build script and add some comments