restructure, add chat page support & fix #4