reorganize web and refactor js