Fixed how default page is handled, as well as little refactor.