Restructured the whole application