public sites. script refactor