fixed bug in the last refactoring, put some order in script tags