refactor site and app