fix bugs, improve routing and rendering