edit site.
and some refactoring